package com.example.d01线程的实现.testThread;


//创建线程方式一：继承Thread,重新run方法，start启动多线程
public class test1 extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 30; i++) {
            System.out.println("子线程");
        }
    }

    public static void main(String[] args) {
        //创建线程对象
        test1 test=new test1();

        //开启线程
        test.start();

        for (int i = 0; i < 200; i++) {
            System.out.println("主线程");
        }


    }
}
